/**
 * AZ翻译插件 - 内容脚本
 * @author huangguohui2002
 * @description 注入翻译组件到网页内容中
 */

import { createApp } from "vue";
import HghTranslate from "@/components/HghTranslate.vue";
export default defineContentScript({
  matches: ["*://*/*"],
  main(ctx) {
    const ui = createIntegratedUi(ctx, {
      position: "inline",
      anchor: "body",
      onMount: (container) => {
        const app = createApp(HghTranslate);
        app.mount(container);
        return app;
      },
      onRemove: (app) => {
        if (app) {
          app.unmount();
        }
      },
    });

    ui.mount();
  },
});
 